;;;
;;;
;;;	Author:
;;;		Henry C. Francis
;;;		425 N. Ashe St.
;;;		Southern Pines, NC 28387
;;;
;;;	http://www.paracadd.com
;;;	All rights reserved.
;;;
;;;	Copyright:	7-9-1999
;;;	   Edited:	7-9-1999
;;;
(defun c:flip ()
  (while
    (and (setq sel_item (entsel "\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010\010Select block to flip. "))
	 (if sel_item (or
			(and
                          (or
                            (and
			      (eq(cdr(assoc 0 (entget(car sel_item))))"INSERT")
			      (/=(boole 1 (cdr(assoc 70 (tblsearch "block"(cdr(assoc 2(entget(car sel_item))))))) 4) 4)
                            )
                            (and
			      (eq(cdr(assoc 0 (entget(car sel_item))))"INSERT")
                              (wcmatch(cdr(assoc 2 (tblsearch "block"(cdr(assoc 2(entget(car sel_item))))))) "*_PE")
                            )
                          )
		        )
			(eq(cdr(assoc 0 (entget(car sel_item))))"TEXT")
			(eq(cdr(assoc 0 (entget(car sel_item))))"MTEXT")
		      )
	 )
    )
    (setq sel_edata (entget (car sel_item)))
    (setq iang (cdr(assoc 50 sel_edata)))
    (setq sel_edata (subst (cons 50 (+(if(or(eq(cdr(assoc 0 sel_edata))"TEXT")(eq(cdr(assoc 0 sel_edata))"MTEXT"))(/ PI 2)(/ PI 2))iang))(assoc 50 sel_edata)sel_edata))
    (entmod sel_edata)
    (setq sel_item nil)
  )
  (princ "\nNo block selected! ")
  (princ)
)
;;;****************************************************************************
(defun flip (sel_item / );sel_item is an entity name
  (if (AND
        sel_item
        (or
          (or
            (and
              (eq(cdr(assoc 0 (entget(car sel_item))))"INSERT")
	      (/=(boole 1 (cdr(assoc 70 (tblsearch "block"(cdr(assoc 2(entget(car sel_item))))))) 4) 4)
            )
            (and
	      (eq(cdr(assoc 0 (entget(car sel_item))))"INSERT")
              (wcmatch(cdr(assoc 2 (tblsearch "block"(cdr(assoc 2(entget(car sel_item))))))) "*_PE")
            )
          )
          (eq(cdr(assoc 0 (entget sel_item)))"TEXT")
          (eq(cdr(assoc 0 (entget sel_item)))"MTEXT")
        )
      )
    (PROGN
      (setq sel_edata (entget sel_item))
      (setq iang (cdr(assoc 50 sel_edata)))
      (setq sel_edata (subst (cons 50 (+(if(or(eq(cdr(assoc 0 sel_edata))"TEXT")(eq(cdr(assoc 0 sel_edata))"MTEXT"))(/ PI 2)(/ PI 2))iang))(assoc 50 sel_edata)sel_edata))
      (entmod sel_edata)
    )
  )
  (princ)
)
